﻿using System;
using ilgolosone.Shared.Domain;


namespace ilgolosone.DomainModel.ValueObjects
{
    [Serializable]
    public class ContactInfo : ValueObject<ContactInfo>
    {
        private string _webSite;
        private string _emailAddress;
        private string _phoneNumber;

        public ContactInfo() : this(string.Empty, string.Empty, string.Empty)
        {

        }

        public ContactInfo(string webSite, string emailAddress, string phoneNumber)
        {
            WebSite = webSite;
            EmailAddress = emailAddress;
            PhoneNumber = phoneNumber;

            RegisterProperty(val => val.WebSite);
            RegisterProperty(val => val.EmailAddress);
            RegisterProperty(val => val.PhoneNumber);
        }

        public string WebSite
        {
            get { return _webSite; }
            private set
            {
                _webSite = value;
            }
        }

        public string EmailAddress
        {
            get { return _emailAddress; }
            private set
            {
                _emailAddress = value;
            }
        }

        public string PhoneNumber
        {
            get { return _phoneNumber; }
            private set
            {
                _phoneNumber = value;
            }
        }

        public override string ToString()
        {
            return string.Format("W: {0}, E: {1}, P: {2}", WebSite, EmailAddress, PhoneNumber);
        }
    }
}
